package main

import (
	"bufio"
	"flag"
	"fmt"
	"log"
	"os"
	"sort"
	"strconv"
	"strings"
)

var qs = []float64{10, 50, 75, 95, 99, 99.9, 99.99}

func main() {
	flag.Parse()
	if flag.NArg() > 0 {
		qs = make([]float64, flag.NArg())
		for i := 0; i < flag.NArg(); i++ {
			q, err := strconv.ParseFloat(flag.Arg(i), 64)
			if err != nil {
				log.Fatal(err)
			}
			if q < 0 || q > 100 {
				log.Fatal("quantile %f out of range", q)
			}
			qs[i] = float64(q)
		}
	}

	r := bufio.NewReader(os.Stdin)
	xs := []float64{}
	for {
		l, err := r.ReadString('\n')
		if err != nil {
			break
		}
		l = strings.TrimSpace(l)
		x, err := strconv.ParseFloat(l, 64)
		if err != nil {
			// Count?
			log.Print(err)
			continue
		}
		xs = append(xs, x)
	}

	sort.Float64s(xs)
	n := len(xs)

	for i := 0; i < len(qs); i++ {
		j := int(qs[i] / 100 * float64(n-1))
		fmt.Printf("%0.2f %0.2f\n", qs[i], xs[j])
	}
}
